<!--  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Stock Priority Mapping definition for the Stock Quoter Publisher/Subscriber Real-time CORBA Service</title>
</head>

<body
 text = "#000000"
 link = "#000fff"
 vLink= "#ff0f0f"
 aLink = "#0000ff"
 bgColor = "#ffffff">

<hr><h2>Stock Priority Mapping definition for the Stock Quoter Publisher/Subscriber Real-time CORBA Service</h2><hr>

<P> The Stock Database class defines the priority mappings used by the stock objects.<P>

<h3>Defining the Priority enum</h3>

We define five levels of prioriies as follows: <P>

<PRE>
    enum Priority
    {
      VERY_LOW = 0,
      LOW = 1,
      MEDIUM = 2,
      HIGH = 3,
      VERY_HIGH = 4
    };
</PRE>

<hr><h3>Implementing the register_mapping () function</h3>

The main steps of this function are described as follows: <P>

<li>Get the Priority Mapping Manager.</li> <P>

<PRE>
    CORBA::Object_var obj = orb->resolve_initial_references ("PriorityMappingManager");
    TAO_Priority_Mapping_Manager_var manager = TAO_Priority_Mapping_Manager::_narrow (obj.in ());
</PRE>

<li>Create an instance of Stock Priority Mapping object and install it.</li> <P>

<PRE>
    RTCORBA::PriorityMapping *my_mapping = new Stock::Priority_Mapping;
    manager->mapping (my_mapping);
</PRE>

<hr><b>Email: </b><a href="mailto:"</a<ADDRESS>shanshan.jiang@vanderbilt.edu</ADDRESS>

</body>

</html>
